package com.example.liwushuo;

import com.example.liwushuo.urls.urls;
import com.lidroid.xutils.exception.HttpException;
import com.lidroid.xutils.http.ResponseInfo;
import com.lidroid.xutils.http.callback.RequestCallBack;
import com.lidroid.xutils.http.client.HttpRequest.HttpMethod;

import android.os.Bundle;
import android.view.View;
import android.view.Window;
import android.webkit.WebView;
import android.widget.Toast;
import android.app.Activity;

public class GJActivity extends Activity {

	private WebView web;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		requestWindowFeature(Window.FEATURE_NO_TITLE);
		setContentView(R.layout.activity_gj);
		web = (WebView) findViewById(R.id.GLWebView);
		LoadData();

	}

	private void LoadData() {
		BaseApp.getHttpUtils().send(HttpMethod.GET, urls.getTTGJUrl,
				new RequestCallBack<String>() {

					@Override
					public void onFailure(HttpException arg0, String arg1) {
						Toast.makeText(getApplicationContext(), "网络连接失败，请检查网络",
								1).show();

					}

					@Override
					public void onSuccess(ResponseInfo<String> response) {
						web.loadData(response.result,
								"text/html;charset=utf-8", "utf-8");
					}
				});
	}
}
